package com.hs.chd.helper;

import java.util.Map;
import java.util.Observable;
import java.util.Observer;

import com.hs.core.db.DBMgr;

public class DataImpObserver  implements Observer{

	public void update(Observable o, Object arg) {
		  DBMgr dbo = DBMgr.getDbUtilInst();
		  System.out.println("arg:" + arg);
		  Map data = (Map)arg;
		  Long fileid = (Long)data.get("fileid");
		  Long currnum = (Long)data.get("currnum"); 
		  Long allnum = (Long)data.get("allnum"); 
		 //判断当前导入的数量与全部数量是否相等，相等则改变导入的状态
		  if(currnum.intValue() == allnum.intValue()){
			   dbo.update("update SCHD_IMPFILEINFO set IMPCURRNUM=?,IMPSTATUS=4 where id=?", new Object[]{allnum,fileid});
		  }else{
			   dbo.update("update SCHD_IMPFILEINFO set IMPCURRNUM=? where id=?", new Object[]{currnum,fileid});
		  }
		  
 	}

}
